package cn.dnui_zjq823.dnuifood_16110100823.model;

/**
 * Created by dell on 2018/11/22.
 */

import cn.dnui_zjq823.dnuifood_16110100823.iface.CollectIface;
import cn.dnui_zjq823.dnuifood_16110100823.listener.onRetrofitListener;
import cn.dnui_zjq823.dnuifood_16110100823.service.CollectService;

import retrofit2.Call;

public class CollectModel extends BaseModel implements CollectIface {
    private CollectService service;
    public CollectModel(){
        super();
        service=retrofit.create(CollectService.class);
    }

    @Override
    public void userCollectShop(int user_id, int shop_id, onRetrofitListener listener) {
        Call call=service.userCollectShop(user_id,shop_id);
        bindCallback(call,listener,4);
    }
    @Override
    public void userCollectFood(int user_id, int food_id, onRetrofitListener listener) {
        Call call=service.userCollectFood(user_id,food_id);
        bindCallback(call,listener,4);
    }
    @Override
    public void isCollected(int user_id, int shop_food_id, int flag, onRetrofitListener listener) {
        Call call=service.isCollected(user_id,shop_food_id,flag);
        bindCallback(call,listener,flag);
    }
    public void getAllUserCollection(int user_id,int flag,onRetrofitListener listener){
        Call call=service.getAllUserCollection(user_id,flag);
        bindCallback(call,listener,flag);
    }
}
